package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.CategoryReportService;
import com.qingcheng.service.order.OrderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class OrderTask {


    @Reference
    private OrderService orderService;

    @Reference
    private CategoryReportService categoryReportService;


    @Scheduled(cron="* * 1 * * ?")
    public void orderTimeOutLogin(){
        System.out.println("每间隔时间执行一次"+ new Date());
        orderService.orderTimeOutLog();
    }

//    @Reference
//    private CategoryReportService categoryReportService;
//
//
//    public void cateCategoryReportDate(){
//        System.out.println("生成类目统计数据");
//    }

    @Scheduled(cron = "0 04 22 * * ?")
    public void categoryReportDate(){
        System.out.println("categoryReportDate");
        categoryReportService.createDate();
    }

}
